import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: 'login',
  },
  {
    path: '/login',
    name: 'login',
    component: () => import("@/views/Login.vue")
  },
  {
    path: '/main',
    name: 'mian',
    redirect: '/system/user/userList',
    component: () => import("@/views/Main.vue"),
    children: [
      {
        path: '/system/user/userList',
        name: 'userList',
        component: () => import("@/views/system/user/userList.vue")
      },
      {
        path: '/system/role/roleList',
        name: 'roleList',
        component: () => import("@/views/system/role/roleList.vue")
      },
      {
        path: '/system/menu/menuList',
        name: 'menuList',
        component: () => import("@/views/system/menu/menuList.vue")
      },
      {
        path: '/shop/banner/bannerList',
        name: 'bannerList',
        component: () => import("@/views/shop/banner/bannerList.vue")
      },
      {
        path: '/shop/cart/cartList',
        name: 'cartList',
        component: () => import("@/views/shop/cart/cartList.vue")
      },
      {
        path: '/shop/category/categoryList',
        name: 'categoryList',
        component: () => import("@/views/shop/category/categoryList.vue")
      },
      {
        path: '/shop/goods/goodsList',
        name: 'goodsList',
        component: () => import("@/views/shop/goods/goodsList.vue")
      },
      {
        path: '/shop/order/orderList',
        name: 'orderList',
        component: () => import("@/views/shop/order/orderList.vue")
      },
    ]
  },
]

const router = new VueRouter({
  routes
})

export default router
